<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <script src="../../js/jquery-1.10.1.min.js"></script> -->
    <!-- <script src="../../js/jquert2.2.4.min.js"></script> -->
    <script src="../../js/jquery-3.6.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        a {
            color: inherit;
            text-decoration: none;
        }
        .sub {
            width: max-content;
            height: max-content;
            margin: 0 auto;
        }

        .box {
            /* overflow: hidden;
            min-width: min-content; */
            float: left;
        }

        .box a {
            width: 100px;
            height: 45px;
            line-height: 45px;
            float: left;
            text-align: center;
            background-color: #f2f2f2;
            margin-bottom: 5px;
        }

        .box a+a {
            margin-left: 10px;
        }

        .wrap {
            position: relative;
        }

        .wrap div {
            clear: both;
            width: 540px;
            height: 200px;
            border: 1px solid #333;
            text-align: center;
            line-height: 200px;
            position: absolute;
            left: 0;
            top: 50px;
            display: none;
        }
    </style>
</head>

<body>
    <div class="sub">
        <div class="box">
            <a href="javascript:;">按钮</a>
            <a href="javascript:;">按钮</a>
            <a href="javascript:;">按钮</a>
            <a href="javascript:;">按钮</a>
            <a href="javascript:;">按钮</a>
        </div>
        <div class="wrap">
            <div style="display: block;">01</div>
            <div>02</div>
            <div>03</div>
            <div>04</div>
            <div>05</div>
        </div>
    </div>
</body>
<script>
    $(".box a").mouseenter(function () {
        $(this).css({backgroundColor: "red"}).siblings().css({backgroundColor: ""});
        var index = $(this).index();
        $(".wrap div").eq(index).show().siblings().hide();
    });
    
</script>

</html>